Skip to content

feat(Badge): add square prop#4008

Merged
benjamincanac merged 5 commits intonuxt:v3from
zAlweNy26:feat/square-badge
May 13, 2025
Merged

feat(Badge): add square prop#4008
benjamincanac merged 5 commits intonuxt:v3from
zAlweNy26:feat/square-badge

Conversation

@zAlweNy26
Copy link
Copy Markdown
Contributor

🔗 Linked issue

Resolves #4006

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

As said in the linked issue, it would facilitate the use of the Badge component when you use only the icon prop without any label.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@zAlweNy26
Copy link
Copy Markdown
Contributor Author

@benjamincanac sorry but where am I missing the type definition?

Comment thread src/theme/badge.ts Outdated
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 4, 2025

npm i https://pkg.pr.new/@nuxt/ui@4008

commit: 3a9c1e0

@benjamincanac benjamincanac added the v3 #1289 label May 7, 2025
Comment thread src/theme/badge.ts Outdated
},
md: {
base: 'text-xs px-2 py-1 gap-1 rounded-md',
base: 'text-xs px-2 py-1.5 gap-1 rounded-md',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change the theme here? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benjamincanac I did that to have different sizes when the badge is square. But maybe it's better to match the x padding instead of the y ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The square variant should apply p-1 on md size in this case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benjamincanac sorry I don't understand why, do you want me to reset the size variants to the original values and let the square variant match the y padding?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly, we shouldn't change the default values.

@benjamincanac benjamincanac changed the title feat(Badge): add square prop feat(Badge): add square prop May 13, 2025
@benjamincanac benjamincanac merged commit 894e8a6 into nuxt:v3 May 13, 2025
6 checks passed
@benjamincanac
Copy link
Copy Markdown
Member

Thanks 😊

@zAlweNy26 zAlweNy26 deleted the feat/square-badge branch May 15, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 #1289

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Badge] introduce prop square

3 participants